package org.ddl.sample.mapper;

import java.util.List;

import org.ddl.core.annotation.DataSourceShard;
import org.ddl.core.annotation.DataSourceShardOn;
import org.ddl.core.annotation.DefaultDataSource;
import org.ddl.sample.model.Student;
import org.springframework.stereotype.Repository;

// 数据源路由
@DataSourceShard(logicDataSource = "ds", dataSourceShardNum = 2, dataSourceShardType = "mod")

// 分表路由
// @TableShard()

@Repository
public interface StudentMapper {
	/**
	 * 获取华北区域的所有学生
	 * 
	 * @return
	 */
	@DefaultDataSource("ds0")
	List<Student> getAllNCStudents();

	/**
	 * 根据schoolId获取学生数据
	 * 
	 * @param schoolId
	 * @return
	 */
	List<Student> getStudentsBySchoolId(@DataSourceShardOn Long schoolId);

}